* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 1rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: #e2e8f0;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.welcome-card, .user-card, .knowledge-card, .register-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.welcome-card h2 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 1rem;
}

.welcome-card p {
    text-align: center;
    color: #718096;
    margin-bottom: 2rem;
}

/* Hello World 功能样式 */
.hello-world-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 15px;
    border: 2px dashed #0ea5e9;
}

.hello-world-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.hello-world-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.hello-world-btn:active {
    transform: translateY(-1px);
}

.hello-world-output {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #0369a1;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bae6fd;
}

/* Hello World 动画效果 */
@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item h3 {
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: #718096;
    font-size: 0.9rem;
}

.user-info, .knowledge-item {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.loading {
    text-align: center;
    color: #718096;
    font-style: italic;
}

.knowledge-list {
    display: grid;
    gap: 1rem;
}

.knowledge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.knowledge-item h4 {
    color: #4a5568;
}

.knowledge-item .category {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.knowledge-item .difficulty {
    color: #718096;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    nav {
        flex-wrap: wrap;
    }
    
    main {
        padding: 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .register-card {
        padding: 1.5rem;
    }
    
    .register-form {
        gap: 1rem;
    }
}

/* 用户注册页面样式 */
.register-card {
    max-width: 500px;
    margin: 0 auto;
}

.register-card h2 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.register-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.form-group input:valid {
    border-color: #48bb78;
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #f56565;
}

.field-error {
    color: #f56565;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
    display: block;
}

.register-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.register-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.register-submit-btn:active {
    transform: translateY(0);
}

.register-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.register-submit-btn.loading .btn-text {
    display: none;
}

.register-submit-btn.loading .btn-loading {
    display: inline;
}

.register-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    min-height: 20px;
}

.register-result.success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #2d7d32;
    border: 1px solid #48bb78;
}

.register-result.error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    border: 1px solid #f56565;
}

.register-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.register-footer p {
    color: #718096;
    margin: 0;
}

.login-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.register-card {
    animation: slideInUp 0.6s ease-out;
}

/* 表单验证视觉反馈 */
.form-group.success input {
    border-color: #48bb78;
    background: #f0fff4;
}

.form-group.error input {
    border-color: #f56565;
    background: #fffafa;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}